# Maintainer: Balló György <ballogyor+arch at gmail dot com>
# Contributor: Fabian Bornschein <fabiscafe-cat-mailbox-dog-org>

pkgname=gnome-tour
pkgver=45.0
pkgrel=1
pkgdesc='Guided tour and greeter for GNOME'
arch=('loong64' 'x86_64')
url='https://gitlab.gnome.org/GNOME/gnome-tour'
license=('GPL3')
depends=('gcc-libs' 'glib2' 'glibc' 'gtk4' 'hicolor-icon-theme' 'libadwaita'
         'pango')
makedepends=('appstream-glib' 'meson' 'rust')
groups=('gnome')
source=("https://download.gnome.org/sources/$pkgname/${pkgver%.*}/$pkgname-$pkgver.tar.xz")
sha256sums=('5be4b8ef4b8f4d5ecaccc31048db6e085a8f7bffadaa0843b8e8a788ff1dadee')

# Use LTO
export CARGO_PROFILE_RELEASE_LTO=true CARGO_PROFILE_RELEASE_CODEGEN_UNITS=1

# Use debug
export CARGO_PROFILE_RELEASE_DEBUG=2

build() {
  arch-meson $pkgname-$pkgver build
  find -name Cargo.lock -exec rm -f {} \;
  mkdir -p .cargo
  cat > .cargo/config.toml <<EOF
[source.crates-io]
registry = "https://gitee.com/yetist/crates.io-index"
EOF
  meson compile -C build
}

check() {
  meson test -C build --print-errorlogs
}

package() {
  meson install -C build --destdir "$pkgdir"
}
